function cancel() {
	history.back();
}
var token = sessionStorage.getItem("token");
var appid = sessionStorage.getItem("appid");
var username = sessionStorage.getItem("username");
var vue = new Vue({
	el: "body",
	data: {
		coll_list: [],
		post: [],
		isloading: true
	},
	created: function() {
//		if(username == null) {
//			location.href = "../load/load.html"
//		} else {
			this.getList();
//		}
	},
	methods: {
		getList: function() {
			$.ajax({
				type: 'get',
				url: 'http://v2.mashupcloud.cn/SQL/getPostid/',
				data: {
					appid: appid,
					token: token,
					name: 'getPostid',
					_v1: username, //参数1  _v3,_v4 ......
				},
				success: function(json) {
					console.log("json==" + json);
					vue.coll_list = JSON.parse(json)[2];
					vue.isloading = false;
					console.log(vue.coll_list);
					for(var i = 0; i < vue.coll_list.length; i++) {
						vue.getPost(i);
					}
				},
				error: function(json) {
					console.log("err:" + json);
				}
			});
		},
		getPost: function(i) {
			$.ajax({
				type: 'get',
				url: 'http://v2.mashupcloud.cn/SQL/get_post_detail/',
				data: {
					appid: appid,
					token: token,
					name: 'get_post_detail',
					_v1: vue.coll_list[i].postID, //参数1  _v3,_v4 ......
				},
				success: function(json) {
					console.log("json==" + json);
					vue.post.push(JSON.parse(json)[2][0]);
					console.log(vue.post)
				},
				error: function(json) {
					console.log("err:" + json);
				}
			});
		},
		goToDetail: function(index) {
			sessionStorage.setItem("postID", this.post[index].ID);
			location.href = "../details/details.html"
		}
	}
});